package com.liuxy.androidutil;

import android.annotation.TargetApi;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.os.Build;

public class BluetoothUtil {
	private static final String TAG = "MyTools.BluetoothUtil";
	/**
	 * Requires Permission: {@link android.Manifest.permission#BLUETOOTH}
	 */
	@TargetApi(Build.VERSION_CODES.ECLAIR)
	public static String getBluetoothAddress(Context ctx){
		BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); // Local Bluetooth adapter      
		return bluetoothAdapter==null?null:bluetoothAdapter.getAddress();
	}
	
	private BluetoothUtil(){
		/* cannot be instantiated */
		throw new UnsupportedOperationException(TAG+" cannot be instantiated");
	}
}
